package com.linwen.javase.desgin_pattern.action.vistior;

/**
 * @ClassName VisitorTest
 * @Description
 * @Author lin
 * @Date 2022/6/30 上午12:38
 * @Version V1.0
 */
public class VisitorTest {
    public static void main(String[] args) {
        ObjectStructure os = new ObjectStructure();
        os.add(new ConcreteElementA());
        os.add(new ConcreteElementB());
        Visitor visitor = new ConcreteVisitorA();
        os.accept(visitor);
        System.out.println("------------------------");
        visitor = new ConcreteVisitorB();
        os.accept(visitor);
    }
}
